﻿using Outlook = Microsoft.Office.Interop.Outlook;

namespace TrackIT.Common.Providers
{
    public class EmailProvider : IEmailProvider
    {
        public void CreateEmail(string recipient, string subject, string body, string filename)
        {
            Outlook.Application oApp = new Outlook.Application();
            Outlook._MailItem oMailItem = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
            oMailItem.To = recipient;
            oMailItem.Attachments.Add(filename);
            oMailItem.Subject = subject;
            oMailItem.Body = body;
            oMailItem.Display(true);
        }
    }
}